#ifndef COOLPOOL_SIMULATION_WORLDCELL_H_
#define COOLPOOL_SIMULATION_WORLDCELL_H_

#include "Entity.h"
#include "EntitiesContainer.h"

namespace coolpool
{
	// One cell of the world grid, it is formally a container of pointers to entities,
	// which lies in it.
	class WorldCell
	{
	public:

		WorldCell()
		{

		}

		virtual ~WorldCell()
		{

		}

		// Adds an entity to the cell.
		inline void addEntity(Entity * entity)
		{
			if (entity->isStatic())
				statics_.push_back(entity);
			else
				dynamics_.push_back(static_cast<DynamicEntity *> (entity));
		}

		// Clears both lists.
		inline void clearAll()
		{
			statics_.clear();
			dynamics_.clear();
		}

		inline void clearDynamics()
		{
			dynamics_.clear();
		}

		inline void clearStatics()
		{
			statics_.clear();
		}

		// Getters:
		inline EntitiesPointers * getStatics()
		{
			return &statics_;
		}

		inline DynamicEntitiesPointers * getDynamics()
		{
			return &dynamics_;
		}

	private:

		// Container of static entities.
		EntitiesPointers statics_;

		// Container of dynamic entities.
		DynamicEntitiesPointers dynamics_;
	};
}

#endif
